package com.example.data.permission.url;

import lombok.Getter;

/**
 * Created by TD on 2021/8/9
 */
public class SecurityException extends RuntimeException {

    private static final long serialVersionUID = 2359767895161832954L;

    @Getter
    private final StatusCodeEnum resultCode;

    public SecurityException(String message) {
        super(message);
        this.resultCode = StatusCodeEnum.ACCESS_DENIED;
    }

    public SecurityException(StatusCodeEnum resultCode) {
        super(resultCode.getMsg());
        this.resultCode = resultCode;
    }

    public SecurityException(StatusCodeEnum resultCode, Throwable cause) {
        super(cause);
        this.resultCode = resultCode;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }
}
